﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using SGD;

namespace ParticleEditor
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Form1 PtclEditor = new Form1();

            float startTime = Environment.TickCount;
            float ElapsedTime = 0;
            float Dtime = 0;
            float previousTime = 0;

            PtclEditor.Show();

            while (!ManagedDirect3D.Instance.Device.Disposed)
            {
                ElapsedTime = (Environment.TickCount - startTime) / 1000;

                Dtime = (ElapsedTime - previousTime);

                if(Dtime > 0.125f)
                    Dtime = 0.125f;

                PtclEditor.Update(Dtime); //overload the update
                //PtclEditor.InterfaceUpdate(); might not need to create this
                PtclEditor.Render(); //make this too

                Application.DoEvents();

                previousTime = ElapsedTime;
            }
        }
    }
}
